UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+rUgAzRnCH13Cm04cye2LiSRPDGuofttqxoA/Gzd/TY=' 
WHERE 
  key_id = '0f1e7692d2737239645c72404af5bd25bdd4e969e8b2b5c51ab51f15cddd66b2' 
  AND (
    token = '+rUgAzRnCH13Cm04cye2LiSRPDGuofttqxoA/Gzd/TY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050