UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7eIpZiJ7fPnhJcToIPrJtCwSMvev8IM7p7oRK38GLlo=' 
WHERE 
  key_id = '72a8df18b08961c2396b9395bb777d827e9d067d839bb5628e8736cfcb1d1c44' 
  AND (
    token = '7eIpZiJ7fPnhJcToIPrJtCwSMvev8IM7p7oRK38GLlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032