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