UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uzNpVeJ1atiwyo/qvWv1+nibUtcvRgWxIg73jN37OQE='
WHERE
key_id = '2c4d77b4c51df21d7b727bf6e8b5625f8ddd655cabfb68c14967e66707c93fb5'
AND (
token = 'uzNpVeJ1atiwyo/qvWv1+nibUtcvRgWxIg73jN37OQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)