UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hGHVv7myKLp1oPF4hkXv5N2SxirlpTf9GduNKYD8NGY=' 
WHERE 
  key_id = '28c4411e4dc11ea7c8f80811e33e2ea524048578f8970fa4ed4770df15e3048a' 
  AND (
    token = 'hGHVv7myKLp1oPF4hkXv5N2SxirlpTf9GduNKYD8NGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038