UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YUdWrMN+3Fwb/sLWZIbLIaakFgb3dUhl+xZkL7i70vU='
WHERE
key_id = '8c53458b46f8f3ccd7ddee4f7ea200d5b5bf5a3feee2040ebe2f076e7e01c04f'
AND (
token = 'YUdWrMN+3Fwb/sLWZIbLIaakFgb3dUhl+xZkL7i70vU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)