UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mgyebpxn2OX/6d42sAfa1NH5BIZ/u8m+EzbMLTzpQ5w=' 
WHERE 
  key_id = '5d19006107f8654a0a46be637f4bfb156bfd3ee6ca74c3e686aa1d49d690ce56' 
  AND (
    token = 'Mgyebpxn2OX/6d42sAfa1NH5BIZ/u8m+EzbMLTzpQ5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034