UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fq1xkLI+LfpLo9izMWQz4dZz+3m4pPal7HeRWwpQcQc='
WHERE
key_id = '37097788599880877dc630daa27594e7fca5e50c5635f6a89162e2f932757880'
AND (
token = 'fq1xkLI+LfpLo9izMWQz4dZz+3m4pPal7HeRWwpQcQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)