UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MPMEXNa+B3KNsfrphvkx+YCp0OdS3Mr/ByFqGNblDVM=' 
WHERE 
  key_id = 'de06994db1f838d1df580ea4198da436ad5ffca7b1925fe325942ff02c2606c1' 
  AND (
    token = 'MPMEXNa+B3KNsfrphvkx+YCp0OdS3Mr/ByFqGNblDVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024