UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dvgxb2GFViSHe2zFM6tb1VFjenDSSBIjFNntaw9LFMA='
WHERE
key_id = '308f0ebf9ec951d67ee8c9052a38ea0c4143422e7a6ee6116079bd7012f3706e'
AND (
token = 'dvgxb2GFViSHe2zFM6tb1VFjenDSSBIjFNntaw9LFMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)