UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zG1ZSzjbgxjK86VK74Xo1YZhUVc5GplkZ+jJPC3uilo='
WHERE
key_id = 'cab7c9b2713127d0cc9cb8701a3b1b04ea9da84bff6a72cb5c917d00f4014a67'
AND (
token = 'zG1ZSzjbgxjK86VK74Xo1YZhUVc5GplkZ+jJPC3uilo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)