UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NZFq7U/9JtdeSPVjCvCBlYCj9kDSeoxNGDMmZ7XAyoc='
WHERE
key_id = '9f5bb9bfa3cf5b3d1da9206d47df06374a061b767ca8ee13a6d760b0c14e7809'
AND (
token = 'NZFq7U/9JtdeSPVjCvCBlYCj9kDSeoxNGDMmZ7XAyoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)