UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'js8Yj0eg3S1rCLw+eieEfQ34aVgXbQU8QgOCUxI/XoQ=' 
WHERE 
  key_id = 'c92dc50f4f77719815820ab8f710ea03e51c6ec0fb8edbeaa3606d317e11cc94' 
  AND (
    token = 'js8Yj0eg3S1rCLw+eieEfQ34aVgXbQU8QgOCUxI/XoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029