UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pIKJHbXfMk+Y2nZWWo5Sls0vZYAkGh/QtHR7IU7Nrhc='
WHERE
key_id = '6f9e44014cec48c2ec90087a52127d255c57ea86e9a99f27a16d3a34b2e1ecbc'
AND (
token = 'pIKJHbXfMk+Y2nZWWo5Sls0vZYAkGh/QtHR7IU7Nrhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)