UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x6IFFR2qZ6Soax6ZqhSvoGNwolKtorQpHPRYRM3tiE8=' 
WHERE 
  key_id = '0888933f21d9096c789ac9fcd38dd292e2286ad5368ab06ba489b94e5926e986' 
  AND (
    token = 'x6IFFR2qZ6Soax6ZqhSvoGNwolKtorQpHPRYRM3tiE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028