UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xtElq/h5KDBXtTZhS24iMMI03v6rsLOr/PTw8+3bgfI='
WHERE
key_id = '654b5bf74bb0544e03d166ae4733fbbe83557176c441b91eb0eb378aae166555'
AND (
token = 'xtElq/h5KDBXtTZhS24iMMI03v6rsLOr/PTw8+3bgfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)