UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'usHmZCE6DCYrYIJte9HjiYQL6yekalP5Ni1TWJAfDBI='
WHERE
key_id = '32ef0e1e95ede123861f7f6562c994660d0ced912c40d6bd6f5503609860ea75'
AND (
token = 'usHmZCE6DCYrYIJte9HjiYQL6yekalP5Ni1TWJAfDBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)