UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VU3B44fWk+bvXStauUkp/qlgbJkzYve8KHojljOmUUA='
WHERE
key_id = '1f2684d3b99ba5886992f0846b8467aa5c6588406f65e851d410e5c749dc629a'
AND (
token = 'VU3B44fWk+bvXStauUkp/qlgbJkzYve8KHojljOmUUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)