UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYe6EwXWlD1TZ8/T2ubEArzBibY/ihRfAJ6EsOeVO7Q='
WHERE
key_id = '703356514882e863049686e92b42edddb854e5e44297f987c54adc0942129e3a'
AND (
token = 'hYe6EwXWlD1TZ8/T2ubEArzBibY/ihRfAJ6EsOeVO7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)