UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rv1vn/mqGwXj/jeNBRZlw5v/qWuccp3Zm/uDjdTdTQY='
WHERE
key_id = 'a3c4274ccd30feff8f6e8f1d3746dfbdb5c6afc49d0e322e7169ecbccc4457e5'
AND (
token = 'rv1vn/mqGwXj/jeNBRZlw5v/qWuccp3Zm/uDjdTdTQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)