UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3U+UUv73EReZXqNrv3yN7WCpATxP+azKNXiD5abXrKs='
WHERE
key_id = '5a1e02fcc13069d9b1052b3cba2a081462ce36cb8eddbd780c8faa9280503861'
AND (
token = '3U+UUv73EReZXqNrv3yN7WCpATxP+azKNXiD5abXrKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)