UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwT5SsHCrJDydR+AcFgp7exU0xnLk059hsuPm7MD1xE='
WHERE
key_id = 'c596c7dca1a3562d0ce710a09bb3ad8c19716c9304c86c3fce796550caefa18e'
AND (
token = 'uwT5SsHCrJDydR+AcFgp7exU0xnLk059hsuPm7MD1xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)