UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7yUZQ+VdJeOC9oT27GYdYGT0ahJI4MpJe1wy7FyiWBc='
WHERE
key_id = '1563f083b67e68a5a43e043d7482377d0906f49c51e11a7719b569ed3048941c'
AND (
token = '7yUZQ+VdJeOC9oT27GYdYGT0ahJI4MpJe1wy7FyiWBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)