UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wdJA8yVwZBWagcPpzFFFn7GDBRmP84BkcnWdlnvGS90='
WHERE
key_id = 'f72dc332e9aad70f0a54f497ccc81bdb1d52be4c3595ed7beb8840af157d1dab'
AND (
token = 'wdJA8yVwZBWagcPpzFFFn7GDBRmP84BkcnWdlnvGS90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)