UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MHgfsCHtC1O4RjpgAinD7YyIAhVDGnoinNETYpmSAYU=' 
WHERE 
  key_id = '6e89c152d3038379380e5706bbf5f2fa523484977e7517f31fd15b3d1ffa9b63' 
  AND (
    token = 'MHgfsCHtC1O4RjpgAinD7YyIAhVDGnoinNETYpmSAYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026