UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sfONY7lkgnaacj46zfnMzDVGJwI9vlDoN8xsc2Uryvo='
WHERE
key_id = '5034b95d74e97c1b8e38ebd48ac2c4773f51bde7c957a9146a780a97371f416c'
AND (
token = 'sfONY7lkgnaacj46zfnMzDVGJwI9vlDoN8xsc2Uryvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)