UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0naUeZLnBDJxcmSslqHBJnLIMn3Q+896a8OMRwPBxw8='
WHERE
key_id = '4168464a17b39a949951ca5b4827cfdb4daa9d4003a0bf59af57671e0a1befff'
AND (
token = '0naUeZLnBDJxcmSslqHBJnLIMn3Q+896a8OMRwPBxw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)