UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3nkrc4Uvgmi4jtXSvENTOGvjq/DdlTIjHpy9V6R18xQ=' 
WHERE 
  key_id = '4f4ec683473efa6a6930cf8fb3a3ed79dddab0a84d338e2f3d2d65a78276f0b6' 
  AND (
    token = '3nkrc4Uvgmi4jtXSvENTOGvjq/DdlTIjHpy9V6R18xQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030