UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '07F7pFGt/TUIpek+rnQh0+z3JFxKSZtO5cIylSvULxs='
WHERE
key_id = 'fd5d4345aad69181cb304fc8230774e4b12ed7457eae8190de2e6a8d3d506e88'
AND (
token = '07F7pFGt/TUIpek+rnQh0+z3JFxKSZtO5cIylSvULxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)