UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3aCBKhhOSNKvLiz/HJhw1QEqEUNT4j+bqEN15/P11ks='
WHERE
key_id = '09b6bdabbae2b19e7ba90e4fba9b9731caeb8a6e70582ef83fc636d047361d48'
AND (
token = '3aCBKhhOSNKvLiz/HJhw1QEqEUNT4j+bqEN15/P11ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)