UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DuJKEWtQDuXNO3yN7WnXgMH6ANjadgsOjXALoJPZIc='
WHERE
key_id = '4a92e8c823c82b359ff075a2df14268c50ba3a108c6d0b882398cdec3da6045c'
AND (
token = '9DuJKEWtQDuXNO3yN7WnXgMH6ANjadgsOjXALoJPZIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)