UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CzQTR/gKRohhy1K1rtyuOkLie9gUhjA0fuCG/qivcWw='
WHERE
key_id = '3902c2899a84b08b53e344c6a8cc42ffcdd578c84b8e8d67b226830258f07afe'
AND (
token = 'CzQTR/gKRohhy1K1rtyuOkLie9gUhjA0fuCG/qivcWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)