UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OsTOvO09G6sFy7QgHFO3mJMOhtkxFHFNd4hWxpm5pIM='
WHERE
key_id = '0affcc682d5efff21c393ce93490ca95ecdc7ea0ca90a950eee72869f1b1f50e'
AND (
token = 'OsTOvO09G6sFy7QgHFO3mJMOhtkxFHFNd4hWxpm5pIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)