UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+ISWckfhA7rdkZQ/QZABfD6Fq8/Dqr2VMidxmrFsY4='
WHERE
key_id = '75901e427c5b8acb0c1d372a497c428a67a4fab4800e671928123f03582f162f'
AND (
token = 'U+ISWckfhA7rdkZQ/QZABfD6Fq8/Dqr2VMidxmrFsY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)