UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kccwdNq8MWd3sHdzBXB+5bEqK5rCNI+/mtE7kYJEfF8='
WHERE
key_id = '76fe5a3fe9da9c11c412c7fdb6db1c5c6e7ef2c88c5bc4ce57f9197ead8f5bb1'
AND (
token = 'kccwdNq8MWd3sHdzBXB+5bEqK5rCNI+/mtE7kYJEfF8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)