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