UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l9UCLeMWoC9wIX7/1ea6/5d3in67nQwinqJoUxtH7PE='
WHERE
key_id = 'd2994a9711a2de9343a2c058e5269b1ffa8285e33496fc75e2ea9906804b6b78'
AND (
token = 'l9UCLeMWoC9wIX7/1ea6/5d3in67nQwinqJoUxtH7PE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)