UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xmwL2R+SPudW9K1d8X2fdgLg/0A8sDfMKQFwHJD9Cng='
WHERE
key_id = '6c269fa8cedef11eb84fbb598777ba8a762166e231956aba123767c86593c80b'
AND (
token = 'xmwL2R+SPudW9K1d8X2fdgLg/0A8sDfMKQFwHJD9Cng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)