UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vXjO4BxPE+4uM3GfrLjyCXCquTcRpSlVIfDUmckOvjk=' 
WHERE 
  key_id = 'd60e9f77ceedee85b02091c32a7e895e014309ec5fdf7e2f1c6292fe09dc2fb7' 
  AND (
    token = 'vXjO4BxPE+4uM3GfrLjyCXCquTcRpSlVIfDUmckOvjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028