UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LkpXKbnSqgueZwedDL7/uKFTAcMtgMjjB00NKLpXRvE=' 
WHERE 
  key_id = '498d6051fffd5e27207dfe50ad35be0e0efbaf4979c07b21e83590e407f81d39' 
  AND (
    token = 'LkpXKbnSqgueZwedDL7/uKFTAcMtgMjjB00NKLpXRvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047