UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCd1eCjLB3ZNK8ACqsUMIfVCGedq6bs9MfIvG3oxxN4='
WHERE
key_id = 'f6adc1726039374d67bad6dae1e55781c09ed58779ca65a65111e230157f8bc7'
AND (
token = 'mCd1eCjLB3ZNK8ACqsUMIfVCGedq6bs9MfIvG3oxxN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)