UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOVqLkucD8/ZQW2stOKR8YtUpHJoXWNtmI1RCKSQNsg=' 
WHERE 
  key_id = '6cdd31cefe931201bc4a12538b0a0ae82f08941cd029be64557b26e4b5cd0d78' 
  AND (
    token = 'jOVqLkucD8/ZQW2stOKR8YtUpHJoXWNtmI1RCKSQNsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022