UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8PWRpVaAwX2akcgKF+8ABfHvRqi57u/fPc309WOmnk='
WHERE
key_id = '6a9abfd506656b527b2e70aaf4ca3c2cb6a3cfce52ace6326c2b6a75783b58da'
AND (
token = 'F8PWRpVaAwX2akcgKF+8ABfHvRqi57u/fPc309WOmnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)