UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yOqu2cAb0A6N1U7d06qB/2JclHMTR68ex39o8RvQ0AQ=' 
WHERE 
  key_id = 'f6b6dc6b0b02fe0b57f8ca3f495484f5865ba4b03d127e9cb04d633efe0ae695' 
  AND (
    token = 'yOqu2cAb0A6N1U7d06qB/2JclHMTR68ex39o8RvQ0AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044