UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GMFzSwHb/+bdsvzJpZbhXOjo794ZO02bjJv7dquF99c='
WHERE
key_id = 'e4bb946e8a928faebdf89f86794752e4ac777beac3d8157073bff9172e112193'
AND (
token = 'GMFzSwHb/+bdsvzJpZbhXOjo794ZO02bjJv7dquF99c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)