UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2J8wt/1HRvOA1uQYEicew/486ImXH6XP2DLFe/WGbBA=' 
WHERE 
  key_id = '5d8f2cfe289c053e37389f8e51668a08beac12fb782c20921f6d0b8a2f500b58' 
  AND (
    token = '2J8wt/1HRvOA1uQYEicew/486ImXH6XP2DLFe/WGbBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051